package com.alkaid.user.mapper;

import com.alkaid.commons.entity.Authority;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Kylin
 */
@Mapper
public interface AuthorityMapper extends BaseMapper<Authority> {

    /**
     * 通过用户id查询权限.
     *
     * @param userId 用户ID
     * @return 权限列表
     */
    List<Authority> findAuthorityByUserId(@Param("userId") Long userId);

    /**
     * 添加用户权限
     *
     * @param authority 权限信息
     * @return 修改行数
     */
    Integer insertAuthority(Authority authority);
}
